package com.atm.atmsys.Mapper.AtmMapper;

import com.atm.atmsys.dto.ATMPageQueryDTO;
import com.atm.atmsys.entity.AdminInfo;
import com.atm.atmsys.entity.AtmInfo;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface AtmMapper {

    //添加Atm机器
    @Insert("insert into atm_info(atm_id,location,atm_status) values (#{atmId},#{location},#{atmStatus})")
    void addAtm(AtmInfo atmInfo);

    //删除Atm机器
    @Delete("delete from atm_info where atm_id = #{id}")
    void deleteAtm(Integer id);




    
    //根据id查询Atm机器
    @Select("select * from atm_info where atm_id = #{id}")
    AtmInfo getAtmById(Integer id);


    //更新Atm机器状态
    @Update("update atm_info set atm_status=#{atmStatus} where atm_id=#{atmId}")
    void updateAtm(AtmInfo atmInfo);

    //查询所有Atm机器
    Page<AtmInfo> pageQuery(ATMPageQueryDTO atmPageQueryDTO);

    //查询所有Atm机器不分页
    @Select("select * from atm_info")
    List<AtmInfo> getAtm();
}
